﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using BadJokeProject.Web.Model;

namespace BadJokeProject
{
    public partial class JokesFrame : UserControl
    {
        public JokesFrame()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Details
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            (this.DataContext as ViewModel).SelectedItem = (sender as Button).Tag as BadJokeItem;
            VisualStateManager.GoToState(this, "Details", true);
        }

        /// <summary>
        /// Back
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            VisualStateManager.GoToState(this, "List", true);
        }
    }
}
